package OOPAndMultiThreadArchiveManager.Server;

import OOPAndMultiThreadArchiveManager.Server.Services.ConnectService;
import OOPAndMultiThreadArchiveManager.Server.Services.FileDownloadService;
import OOPAndMultiThreadArchiveManager.Server.Services.FileUploadService;
import OOPAndMultiThreadArchiveManager.Server.Tools.PropertiesLoader;

import java.util.concurrent.Executors;

public class StartUp {
    public static void main(String[] args) {
        var threadPool = Executors.newFixedThreadPool(3);
        var cacheThreadPool = Executors.newCachedThreadPool();
        new PropertiesLoader().getProperties();
        var connectService = new ConnectService(cacheThreadPool);
        var fileUploadService = new FileUploadService(cacheThreadPool);
        var fileDownloadService = new FileDownloadService(cacheThreadPool);
        threadPool.submit(connectService);
        threadPool.submit(fileDownloadService);
        threadPool.submit(fileUploadService);
    }
}